﻿
namespace Indeco.G24.Windows.Forms
{
	/// <summary>
	/// This is the abstract edit form for the <see cref="Entities.QuanLyFile"/> entity.
	/// </summary>
	/// <remarks>This class is overwritten by .netTiers at each generation.</remarks>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class QuanLyFileEditControlBase : System.Windows.Forms.UserControl
	{
		#region Fields
		
		//private System.Windows.Forms.TableLayoutPanel uxTableLayoutPanel;
		/// <summary>
		/// The ErrorProvider for the Entity;
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxErrorProvider;
		
		/// <summary>
		/// The BindingSource for the entity.
		///</summary>
		protected System.Windows.Forms.BindingSource uxBindingSource;
						
		
		/// <summary>
		/// TextBox for the IDQuanLyFile property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxIDQuanLyFile;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IDQuanLyFile property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDQuanLyFileLabel;
		
		/// <summary>
		/// ComboBox for the IDNguoiDung property.
		/// </summary>
		protected System.Windows.Forms.ComboBox uxIDNguoiDung;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IDNguoiDung property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDNguoiDungLabel;
		
		/// <summary>
		/// TextBox for the ThuMucLuuTru property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxThuMucLuuTru;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the ThuMucLuuTru property.
		/// </summary>
		protected System.Windows.Forms.Label uxThuMucLuuTruLabel;
		
		/// <summary>
		/// TextBox for the TenFileGoc property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxTenFileGoc;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the TenFileGoc property.
		/// </summary>
		protected System.Windows.Forms.Label uxTenFileGocLabel;
		
		/// <summary>
		/// TextBox for the TenFileTrenServer property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxTenFileTrenServer;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the TenFileTrenServer property.
		/// </summary>
		protected System.Windows.Forms.Label uxTenFileTrenServerLabel;
		
		/// <summary>
		/// TextBox for the DungLuong property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxDungLuong;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the DungLuong property.
		/// </summary>
		protected System.Windows.Forms.Label uxDungLuongLabel;
		
		/// <summary>
		/// TextBox for the KieuFile property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxKieuFile;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the KieuFile property.
		/// </summary>
		protected System.Windows.Forms.Label uxKieuFileLabel;
		
		/// <summary>
		/// CheckBox for the TrangThai property.
		/// </summary>
		protected System.Windows.Forms.CheckBox uxTrangThai;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the TrangThai property.
		/// </summary>
		protected System.Windows.Forms.Label uxTrangThaiLabel;
		
		/// <summary>
		/// CheckBox for the Khoa property.
		/// </summary>
		protected System.Windows.Forms.CheckBox uxKhoa;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Khoa property.
		/// </summary>
		protected System.Windows.Forms.Label uxKhoaLabel;
		
		/// <summary>
		/// TextBox for the SoLanDownLoad property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxSoLanDownLoad;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the SoLanDownLoad property.
		/// </summary>
		protected System.Windows.Forms.Label uxSoLanDownLoadLabel;
		
		/// <summary>
		/// DataTimePicker for the ThoiDiemCapNhat property.
		/// </summary>
		protected System.Windows.Forms.DateTimePicker uxThoiDiemCapNhat;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the ThoiDiemCapNhat property.
		/// </summary>
		protected System.Windows.Forms.Label uxThoiDiemCapNhatLabel;
		#endregion
		
		#region Main entity
		private Entities.QuanLyFile _QuanLyFile;
		/// <summary>
		/// Gets or sets the <see cref="Entities.QuanLyFile"/> entity to edit with this form.
		/// </summary>
		/// <value>The <see cref="Entities.QuanLyFile"/> instance.</value>
		public Entities.QuanLyFile QuanLyFile
		{
			get {return this._QuanLyFile;}
			set
			{
				this._QuanLyFile = value;
				if (value != null) 
				{
					this.uxBindingSource.DataSource = value;
					BindControls();
				}			
				
			}
		}
		#endregion
		
		/// <summary>
		/// Binds the controls.
		/// </summary>
		private void BindControls()
		{
			this.uxIDQuanLyFile.DataBindings.Clear();
			this.uxIDQuanLyFile.DataBindings.Add("Text", this.uxBindingSource, "IDQuanLyFile", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxIDNguoiDung.DataBindings.Clear();
			this.uxIDNguoiDung.DataBindings.Add("SelectedValue", this.uxBindingSource, "IDNguoiDung", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxThuMucLuuTru.DataBindings.Clear();
			this.uxThuMucLuuTru.DataBindings.Add("Text", this.uxBindingSource, "ThuMucLuuTru", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxTenFileGoc.DataBindings.Clear();
			this.uxTenFileGoc.DataBindings.Add("Text", this.uxBindingSource, "TenFileGoc", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxTenFileTrenServer.DataBindings.Clear();
			this.uxTenFileTrenServer.DataBindings.Add("Text", this.uxBindingSource, "TenFileTrenServer", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxDungLuong.DataBindings.Clear();
			this.uxDungLuong.DataBindings.Add("Text", this.uxBindingSource, "DungLuong", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxKieuFile.DataBindings.Clear();
			this.uxKieuFile.DataBindings.Add("Text", this.uxBindingSource, "KieuFile", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxTrangThai.DataBindings.Clear();
			this.uxTrangThai.DataBindings.Add("Checked", this.uxBindingSource, "TrangThai", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxKhoa.DataBindings.Clear();
			this.uxKhoa.DataBindings.Add("Checked", this.uxBindingSource, "Khoa", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxSoLanDownLoad.DataBindings.Clear();
			this.uxSoLanDownLoad.DataBindings.Add("Text", this.uxBindingSource, "SoLanDownLoad", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxThoiDiemCapNhat.DataBindings.Clear();
			this.uxThoiDiemCapNhat.DataBindings.Add("Value", this.uxBindingSource, "ThoiDiemCapNhat", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
		}					
		
		#region Constructor
		
		/// <summary>
		/// Initializes a new instance of the <see cref="QuanLyFileEditControlBase"/> class.
		/// </summary>
		public QuanLyFileEditControlBase()
		{
			InitializeComponent();			
			
			this.uxBindingSource.CurrentItemChanged += new System.EventHandler(uxBindingSource_currentItemChanged);
		}		
		
		/// <summary>
		/// 
		/// </summary>
		private void uxBindingSource_currentItemChanged(object sender, System.EventArgs e)
		{
			if (_QuanLyFile != null) _QuanLyFile.Validate();
		}	
				
		/// <summary>
		/// Initializes the component.
		/// </summary>
		public void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			this.uxErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxBindingSource = new System.Windows.Forms.BindingSource(this.components);
			
			//this.uxTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
			this.uxIDQuanLyFile = new System.Windows.Forms.TextBox();
			uxIDQuanLyFileLabel = new System.Windows.Forms.Label();
			this.uxIDNguoiDung = new System.Windows.Forms.ComboBox();
			uxIDNguoiDungLabel = new System.Windows.Forms.Label();
			this.uxThuMucLuuTru = new System.Windows.Forms.TextBox();
			uxThuMucLuuTruLabel = new System.Windows.Forms.Label();
			this.uxTenFileGoc = new System.Windows.Forms.TextBox();
			uxTenFileGocLabel = new System.Windows.Forms.Label();
			this.uxTenFileTrenServer = new System.Windows.Forms.TextBox();
			uxTenFileTrenServerLabel = new System.Windows.Forms.Label();
			this.uxDungLuong = new System.Windows.Forms.TextBox();
			uxDungLuongLabel = new System.Windows.Forms.Label();
			this.uxKieuFile = new System.Windows.Forms.TextBox();
			uxKieuFileLabel = new System.Windows.Forms.Label();
			this.uxTrangThai = new System.Windows.Forms.CheckBox();
			uxTrangThaiLabel = new System.Windows.Forms.Label();
			this.uxKhoa = new System.Windows.Forms.CheckBox();
			uxKhoaLabel = new System.Windows.Forms.Label();
			this.uxSoLanDownLoad = new System.Windows.Forms.TextBox();
			uxSoLanDownLoadLabel = new System.Windows.Forms.Label();
			this.uxThoiDiemCapNhat = new System.Windows.Forms.DateTimePicker();
			uxThoiDiemCapNhatLabel = new System.Windows.Forms.Label();
			
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).BeginInit();
			this.SuspendLayout();
			
			// 
			// uxTableLayoutPanel
			// 
			//this.uxTableLayoutPanel.AutoSize = true;
			//this.uxTableLayoutPanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
			//this.uxTableLayoutPanel.ColumnCount = 2;
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 120F));
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 250F));
			//this.uxTableLayoutPanel.Location = new System.Drawing.System.Drawing.Point(3, 3);
			//this.uxTableLayoutPanel.Name = "uxTableLayoutPanel";
			//this.uxTableLayoutPanel.RowCount = 2;
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.Size = new System.Drawing.Size(450, 50);
			//this.uxTableLayoutPanel.TabIndex = 0;
			
			//
			// uxErrorProvider
			//
			this.uxErrorProvider.ContainerControl = this;
			this.uxErrorProvider.DataSource = this.uxBindingSource;
			
			//
			// uxIDQuanLyFileLabel
			//
			this.uxIDQuanLyFileLabel.Text = "IDQuanLyFile:";
			this.uxIDQuanLyFileLabel.Location = new System.Drawing.Point(3, 0);
			this.Controls.Add(this.uxIDQuanLyFileLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDQuanLyFileLabel);			
			//
			// uxIDQuanLyFile
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDQuanLyFile);
			this.uxIDQuanLyFile.Location = new System.Drawing.Point(160, 0);
			this.Controls.Add(this.uxIDQuanLyFile);
			//
			// uxIDNguoiDungLabel
			//
			this.uxIDNguoiDungLabel.Text = "IDNguoiDung:";
			this.uxIDNguoiDungLabel.Location = new System.Drawing.Point(3, 26);
			this.Controls.Add(this.uxIDNguoiDungLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDNguoiDungLabel);			
			//
			// uxIDNguoiDung
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDNguoiDung);
			this.uxIDNguoiDung.Location = new System.Drawing.Point(160, 26);
			this.Controls.Add(this.uxIDNguoiDung);
			//
			// uxThuMucLuuTruLabel
			//
			this.uxThuMucLuuTruLabel.Text = "ThuMucLuuTru:";
			this.uxThuMucLuuTruLabel.Location = new System.Drawing.Point(3, 52);
			this.Controls.Add(this.uxThuMucLuuTruLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxThuMucLuuTruLabel);			
			//
			// uxThuMucLuuTru
			//
			this.uxThuMucLuuTru.Width = 250;
			this.uxThuMucLuuTru.MaxLength = 2048;
			//this.uxTableLayoutPanel.Controls.Add(this.uxThuMucLuuTru);
			this.uxThuMucLuuTru.Location = new System.Drawing.Point(160, 52);
			this.Controls.Add(this.uxThuMucLuuTru);
			//
			// uxTenFileGocLabel
			//
			this.uxTenFileGocLabel.Text = "TenFileGoc:";
			this.uxTenFileGocLabel.Location = new System.Drawing.Point(3, 78);
			this.Controls.Add(this.uxTenFileGocLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxTenFileGocLabel);			
			//
			// uxTenFileGoc
			//
			this.uxTenFileGoc.Width = 250;
			this.uxTenFileGoc.MaxLength = 1024;
			//this.uxTableLayoutPanel.Controls.Add(this.uxTenFileGoc);
			this.uxTenFileGoc.Location = new System.Drawing.Point(160, 78);
			this.Controls.Add(this.uxTenFileGoc);
			//
			// uxTenFileTrenServerLabel
			//
			this.uxTenFileTrenServerLabel.Text = "TenFileTrenServer:";
			this.uxTenFileTrenServerLabel.Location = new System.Drawing.Point(3, 104);
			this.Controls.Add(this.uxTenFileTrenServerLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxTenFileTrenServerLabel);			
			//
			// uxTenFileTrenServer
			//
			this.uxTenFileTrenServer.Width = 250;
			this.uxTenFileTrenServer.MaxLength = 255;
			//this.uxTableLayoutPanel.Controls.Add(this.uxTenFileTrenServer);
			this.uxTenFileTrenServer.Location = new System.Drawing.Point(160, 104);
			this.Controls.Add(this.uxTenFileTrenServer);
			//
			// uxDungLuongLabel
			//
			this.uxDungLuongLabel.Text = "DungLuong:";
			this.uxDungLuongLabel.Location = new System.Drawing.Point(3, 130);
			this.Controls.Add(this.uxDungLuongLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxDungLuongLabel);			
			//
			// uxDungLuong
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxDungLuong);
			this.uxDungLuong.Location = new System.Drawing.Point(160, 130);
			this.Controls.Add(this.uxDungLuong);
			//
			// uxKieuFileLabel
			//
			this.uxKieuFileLabel.Text = "KieuFile:";
			this.uxKieuFileLabel.Location = new System.Drawing.Point(3, 156);
			this.Controls.Add(this.uxKieuFileLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxKieuFileLabel);			
			//
			// uxKieuFile
			//
			this.uxKieuFile.Width = 250;
			this.uxKieuFile.MaxLength = 50;
			//this.uxTableLayoutPanel.Controls.Add(this.uxKieuFile);
			this.uxKieuFile.Location = new System.Drawing.Point(160, 156);
			this.Controls.Add(this.uxKieuFile);
			//
			// uxTrangThaiLabel
			//
			this.uxTrangThaiLabel.Text = "TrangThai:";
			this.uxTrangThaiLabel.Location = new System.Drawing.Point(3, 182);
			this.Controls.Add(this.uxTrangThaiLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxTrangThaiLabel);			
			//
			// uxTrangThai
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxTrangThai);
			this.uxTrangThai.Location = new System.Drawing.Point(160, 182);
			this.Controls.Add(this.uxTrangThai);
			//
			// uxKhoaLabel
			//
			this.uxKhoaLabel.Text = "Khoa:";
			this.uxKhoaLabel.Location = new System.Drawing.Point(3, 208);
			this.Controls.Add(this.uxKhoaLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxKhoaLabel);			
			//
			// uxKhoa
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxKhoa);
			this.uxKhoa.Location = new System.Drawing.Point(160, 208);
			this.Controls.Add(this.uxKhoa);
			//
			// uxSoLanDownLoadLabel
			//
			this.uxSoLanDownLoadLabel.Text = "SoLanDownLoad:";
			this.uxSoLanDownLoadLabel.Location = new System.Drawing.Point(3, 234);
			this.Controls.Add(this.uxSoLanDownLoadLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxSoLanDownLoadLabel);			
			//
			// uxSoLanDownLoad
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxSoLanDownLoad);
			this.uxSoLanDownLoad.Location = new System.Drawing.Point(160, 234);
			this.Controls.Add(this.uxSoLanDownLoad);
			//
			// uxThoiDiemCapNhatLabel
			//
			this.uxThoiDiemCapNhatLabel.Text = "ThoiDiemCapNhat:";
			this.uxThoiDiemCapNhatLabel.Location = new System.Drawing.Point(3, 260);
			this.Controls.Add(this.uxThoiDiemCapNhatLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxThoiDiemCapNhatLabel);			
			//
			// uxThoiDiemCapNhat
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxThoiDiemCapNhat);
			this.uxThoiDiemCapNhat.Location = new System.Drawing.Point(160, 260);
			this.Controls.Add(this.uxThoiDiemCapNhat);
			//
			// uxIDNguoiDung
			//				
			this.uxIDNguoiDung.DisplayMember = "TenSuDung";	
			this.uxIDNguoiDung.ValueMember = "IDNguoiDung";	
			// 
			// QuanLyFileEditControlBase
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			//this.Controls.Add(this.uxTableLayoutPanel);
			this.AutoScroll = true;
			this.Name = "QuanLyFileEditControlBase";
			this.Size = new System.Drawing.Size(478, 311);
			//this.Localizable = true;
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).EndInit();			
			this.ResumeLayout(false);
			this.PerformLayout();
		}
		#endregion
				
		#region ComboBox List
		
				
		private Entities.TList<Entities.NguoiDung> _IDNguoiDungList;
		
		/// <summary>
		/// The ComboBox associated with the IDNguoiDung property.
		/// </summary>
		[System.ComponentModel.Category("ComboBox BindingSources")]
		public Entities.TList<Entities.NguoiDung> IDNguoiDungList
		{
			get {return _IDNguoiDungList;}
			set 
			{
				this._IDNguoiDungList = value;
				this.uxIDNguoiDung.DataSource = null;
				this.uxIDNguoiDung.DataSource = value;
			}
		}
		
		private bool _allowNewItemInIDNguoiDungList;
		
		/// <summary>
		/// Indicates if the ComboBox associated with the IDNguoiDung property allow user to add item.
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDNguoiDungList
		{
			get { return _allowNewItemInIDNguoiDungList;}
			set
			{
				this._allowNewItemInIDNguoiDungList = value;
				this.uxIDNguoiDung.DropDownStyle = value ? System.Windows.Forms.ComboBoxStyle.DropDown : System.Windows.Forms.ComboBoxStyle.DropDownList;
			}
		}
		
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;

		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	}
}
